/**
 *
 * 数据统计
 * https://www.showdoc.com.cn/1969596173167084/8935799718202144
 *
 */

import { commonPromise } from '../index.js'

// 跨域代理前缀
// const API_PROXY_PREFIX = '/api'
const API_PROXY_PREFIX = ''
const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_BASE_URL : API_PROXY_PREFIX
// const BASE_URL = process.env.VUE_APP_API_BASE_URL

const labelGroupApi = {

  // 人群管理
  classifyGroupAddOrUpdate: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/addOrUpdate`, method: 'post' }), // 新增或修改人群接口(basic:classifyGroup:add)
  classifyGroupEstimate: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/estimate`, method: 'post' }), // 预估人数
  classifyGroupDelete: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/delete`, method: 'post' }), // 删除人群（basic:classifyGroup:delete）
  classifyGroupDetails: (params) => commonPromise({ params, url: `${BASE_URL}/basic/classifyGroup/details`, method: 'get' }), // 人群详细信息查询接口(basic:classifyGroup:view)
  classifyGroupDisable: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/disable`, method: 'post' }), // 暂停人群（basic:classifyGroup:disable）
  classifyGroupEnable: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/enable`, method: 'post' }), // 启用人群（basic:classifyGroup:enable）
  classifyGroupInfo: (params) => commonPromise({ params, url: `${BASE_URL}/basic/classifyGroup/info`, method: 'get' }), // 人群信息查询接口(basic:classifyGroup:view)
  classifyGroupPageList: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/pageList`, method: 'post' }), // 人群分页列表查询接口(basic:classifyGroup:view)
  classifyGroupRuleParam: (params) => commonPromise({ params, url: `${BASE_URL}/basic/classifyGroup/ruleParam`, method: 'get' }), // 人群类型下拉参数类型数据查询接口（basic:classifyGroup:view）
  classifyGroupRuleTypeList: (params) => commonPromise({ params, url: `${BASE_URL}/basic/classifyGroup/ruleTypeList`, method: 'get' }), // 人群类型列表（三级树状）（basic:classifyGroup:view）
  classifyGroupSelectEmployeeKpiExport: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroup/selectEmployeeKpiExport`, method: 'post' }), // 导出指定人群的客户数据
  classifyGroupSelectGroupPeopleDivide: (params) => commonPromise({ params, url: `${BASE_URL}/basic/classifyGroup/selectGroupPeopleDivide`, method: 'get' }), // 查询人群人数分布（权限标识：basic:classifyGroup:view）

  classifyGroupLogPageList: (data) => commonPromise({ data, url: `${BASE_URL}/basic/classifyGroupLog/pageList`, method: 'post' }), // 人群变更记录分页列表查询接口(basic:classifyGroup:view)

  // 标签管理
  tagAddOrUpdate: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/addOrUpdate`, method: 'post' }), // 新增或修改标签接口(basic:tag:add)
  tagDelete: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/delete`, method: 'post' }), // 删除标签（basic:tag:delete）
  tagDetails: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/details`, method: 'get' }), // 标签详细信息查询接口(basic:tag:view)
  tagDisable: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/disable`, method: 'post' }), // 暂停标签（basic:tag:disable）
  tagEnable: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/enable`, method: 'post' }), // 启用标签（basic:tag:enable）
  tagEstimate: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/estimate`, method: 'post' }), // 预估人数
  tagInfo: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/info`, method: 'get' }), // 标签信息查询接口(basic:tag:view)
  tagMoveTag: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/moveTag`, method: 'post' }), // 移动标签（basic:tag:update）
  tagRuleParam: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/ruleParam`, method: 'get' }), // 标签类型下拉参数类型数据查询接口（basic:tag:view）
  tagRuleTypeList: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/ruleTypeList`, method: 'get' }), // 标签类型列表（三级树状）（basic:tag:view）
  tagSelectEmployeeKpiExport: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/selectEmployeeKpiExport`, method: 'post' }), // 导出指定标签的客户数据（权限标识：basic:tag:export）
  tagSelectTagPeopleDivide: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/selectTagPeopleDivide`, method: 'get' }), // 查询标签人数分布（权限标识：basic:tag:view）
  tagUpdateTagName: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/updateTagName`, method: 'post' }), // 重命名标签（basic:tag:update）
  tagUpdateTagUserRelation: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tag/updateTagUserRelation`, method: 'post' }), // 更新标签-客户关系接口(basic:tag:refresh)
  tagGetCustomTagDataList: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tag/getCustomTagDataList`, method: 'get' }), // 获取自定义标签列表

  tagLogPageList: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagLog/pageList`, method: 'post' }), // 标签变更记录分页列表查询接口(basic:tagLog:view)

  // 标签管理 - 标签回收站
  tagRecycleDeleteClassifyGroup: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagRecycle/deleteClassifyGroup`, method: 'post' }), // 彻底删除标签分类(basic:tagRecycle:delete)
  tagRecycleDeleteTag: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagRecycle/deleteTag`, method: 'post' }), // 彻底删除标签(basic:tagRecycle:delete)
  tagRecycleList: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagRecycle/list`, method: 'post' }), // 回收站标签分类级标签列表(basic:tagRecycle:view)
  tagRecycleRecoveryClassifyGroup: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagRecycle/recoveryClassifyGroup`, method: 'post' }), // 恢复标签分类(basic:tagRecycle:recovery)
  tagRecycleRecoveryTag: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagRecycle/recoveryTag`, method: 'post' }), // 恢复标签(basic:tagRecycle:recovery)
  salesAuthority: (params) => commonPromise({ params, url: `${BASE_URL}/sys/v1/user/employee/by/sales/authority`, method: 'get' }), // 删除人列表

  // 标签分类
  tagClassifyAdd: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagClassify/add`, method: 'post' }), // 新增标签分类接口(basic:tagClassify:add)
  tagClassifyDataList: (params) => commonPromise({ params, url: `${BASE_URL}/basic/tagClassify/dataList`, method: 'get' }), // 标签分类列表查询接口(下拉框数据)
  tagClassifyDelete: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagClassify/delete`, method: 'post' }), // 删除标签分类（basic:tagClassify:delete）
  tagClassifyPageList: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagClassify/pageList`, method: 'post' }), // 标签分类列表查询接口(basic:tagClassify:view)
  tagClassifyUpdateName: (data) => commonPromise({ data, url: `${BASE_URL}/basic/tagClassify/updateName`, method: 'post' }), // 重命名标签分类（basic:tagClassify:update）

  // 客户标签
  customertagInfo: (params) => commonPromise({ params, url: `${BASE_URL}/order/comm/customertag/info`, method: 'get' }), // 查询客户的关联标签
  customertagAddCustomTag: (data) => commonPromise({ data, url: `${BASE_URL}/order/comm/customertag/addCustomTag`, method: 'post' }), // 新增客户的自定义标签（权限标识：order:customeruser:addTag）
  customertagDeleteCustomTag: (data) => commonPromise({ data, url: `${BASE_URL}/order/comm/customertag/deleteCustomTag`, method: 'post' }), // 删除客户的自定义标签（权限标识：order:customeruser:deleteTag）
  customertagCalculateTag: (data) => commonPromise({ data, url: `${BASE_URL}/order/comm/customertag/calculateTag`, method: 'post' }), // 计算某个标签
  customertagEstimateTag: (data) => commonPromise({ data, url: `${BASE_URL}/order/comm/customertag/estimateTag`, method: 'post' }), // 预估某个标签的分层人数
  // 自动分配设置
  autoAssign: (data) => commonPromise({ data, url: `${BASE_URL}/order/v1-2/customerUser/autoAssign`, method: 'post' }), // 资源列表-自动分配
  getPreAutoAssignInfo: (data) => commonPromise({ data, url: `${BASE_URL}/order/v1-2/customerUser/getPreAutoAssignInfo`, method: 'post' }) // 资源列表-自动分配所选客户资源的计算总值

}

export default labelGroupApi
